function isOpens(arr = []) {
  const value = arr;

  //const userRoles = getCurrentUserRoles() // 获取当前用户角色的方法
  const userRoles = uni.getStorageSync("user")
    ? JSON.parse(uni.getStorageSync("user")).permissions
    : []; //模拟数据
  if (value && value instanceof Array && value.length > 0) {
    const hasPermission = userRoles.some((role) => {
      // console.log("_______________", value, role, value.includes(role));
      return value.includes(role);
    });
    return hasPermission;
  } else {
    throw new Error(`需要指定权限，例如 v-permission="['admin','editor']"`);
  }
}

export { isOpens };
